// https://vuex.vuejs.org/zh-cn/intro.html
// make sure to call Vue.use(Vuex) if using a module system
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    uid: '',
    unionId: '',
    token: '',
    busRole: '',
    username: '',
    school: {}
  },
  mutations: {

    SET_UID: (state, uid) => {
      state.uid = uid
    },
    SET_UNIONID: (state, unionId) => {
      state.unionId = unionId
    },
    SET_BUS_ROLE: (state, busRole) => {
      state.busRole = busRole
    },
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    SET_USER_NAME: (state, username) => {
      state.username = username
    },
    SET_SCHOOL: (state, school) => {
      state.school = school
    }

  }
})

export default store
